//
// Created by weslywang on 2020/5/1.
//

#include "../common/common.h"

vector<vector<int>> generate(int num) {
    vector<vector<int>> result;
    for (int i = 0; i < num; i++) {
        vector<int> row;
        for (int k = 0; k < i + 1; k++) {
            int tmp = 0;
            if (i - 1 >= 0) {
                if (k - 1 >= 0) {
                    tmp += result[i - 1][k - 1];
                }
                if (k < result[i - 1].size()) {
                    tmp += result[i - 1][k];
                }
            } else {
                tmp = 1;
            }
            row.push_back(tmp);
        }
        result.push_back(row);
    }
    return result;
}

int main() {
    Common common;
    int a[] = {1, 2, 3, 4, 5};
    for (int i = 1; i <= 6; i++) {
        generate(5);
        cout << "**************" << endl;
    }
    return 0;
}